<template>
  <div>
    <h2>孩子二</h2>
    <h3>我的玩具有：{{toy3}}</h3>
  </div>
</template>

<script setup lang='ts' name="Child2">
import emitter from '@/utils/emitter';
import { ref, reactive, onUnmounted } from 'vue'

let toy3 = ref("");

emitter.on("give",(toy:any)=>{
    toy3.value = toy
})

onUnmounted(()=>{
    emitter.off("give")
})

</script>


<style lang='scss' scoped>

</style>